import type { RouteRecordRaw } from 'vue-router'

export const staticRoutes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'login',
    component: () => import('@/views/LoginView.vue'),
    meta: { public: true }
  },
  {
    path: '/home',
    name: 'home',
    component: () => import('@/views/HomeView.vue'),
    meta: { roles: ['user', 'admin']}
  },
  {
    path: '/403',
    name: '403',
    component: () => import('@/views/ForbiddenView.vue'),
    meta: { public: true}
  },
]


// 前端动态路由示例
export const asyncRoutes = [
  {
    path: '/admin',
    name: 'admin',
    component: () => import('@/views/admin/AdminView.vue'),
    meta: { roles: ['admin'] }
  },
  {
    path: '/user',
    name: 'user',
    component: () => import('@/views/user/UserView.vue'),
    meta: { roles: ['user', 'admin'] }
  }
]
